Developer --> Technical Publications
PATH Hardware Documentation > Device Managers and Drivers > ATA Devices > ATA Device Software Guide


ATA_DrvrDeregister

The ATA_DrvrDeRegister function deregisters the driver reference number passed in for the selected drive. After successful completion of this function, the driver reference number for the drive is set to 0, which indicates that there is no driver in control of this device.

The manager function code for the ATA_DrvrDeRegister function is $87.

For notify-all driver deregistration, the ataEHandlerPtr field is used to match the entry (the deviceID field is invalid for the notify-all driver registration/deregistration). If a driver is registered as both a "notify-all" and for a specific device, the driver must deregister for each separately.

All "notify-all" device drivers must deregister using the ata parameter block version 2. The version 1 and version 2 or greater parameter blocks for this function are as follows:

typedef struct /* Driver registration */
/* structure for ataPBVers 1 */
{
ataPBHdr /* ataPBHdr parameter block */
SInt16 drvrRefNum; /* Not used*/
UInt16 FlagReserved; /* Reserved */
UInt16 deviceNextID; /* Not used */
SInt16 Reserved[21]; /* Reserved */
} ataDrvrRegister;

 

typedef struct /* Driver registration */
/* structure for ataPBVers 2 */
/* or greater */
{
ataPBHdr /* ataPBHdr parameter block */
SInt16 drvrRefNum; /* --> Driver reference number */
UInt16 drvrFlags; /* --> Driver flags, set to 0 */
UInt16 deviceNextID; /* Not used */
SInt16 Reserved; /* Reserved (should be 0) */
ProcPtr ataEHandlerPtr; /* --> Event handler */
/* routine pointer */
SInt32 drvrContext; /* --> Value to pass in with */
/* event handler */
UInt32 ataEventMask; /* --> Masks of various events */
/* for event handlers */
SInt16 Reserved[14]; /* Reserved */
} ataDrvrRegister;

Field descriptions

ataPBHdr
See the definition of the ataPBHr parameter block.
drvrRefNum
Not used for this function.
drvrFlags
No bits have been defined for this field. This field shall be set to 0 in order to insure compatibility in the future.
deviceNextID
Not used for this function.
Reserved
Reserved
ataEHandlerPtr
A pointer to the driver event handler routine. This field is only used for "notify-all" driver deregistration. This field is not used for other driver deregistration. Since this field is used to identify the correct "notify-all" driver entry, this field must be valid for "notify-all" driver deregistration.
drvrContext
Not used for this function.
ataEventMask
Not used for this function.
RESULT CODES

See Table A-1 for possible result codes returned by the ATA Manager.


© 1999 Apple Computer, Inc. — (Last Updated 30 Oct 97)

Previous | Back Up One Level | Next | Show Frames | Hide Frames